<template>
   <div>
       单价: <input type="text" name="" v-model="price"> *
       件数：<input type="text" name="" v-model="num"> *
       折扣：<input type="text" name="" v-model="rate"> = 
       {{sum.name}} {{sum.price}}
   </div>
</template>

<script>
   export default {
       data () {
       return {
           price:0,num:0,rate:0
       }
   },
   created(){
   },
   methods: {},
   computed:{
       sum(){
        //    如果原值没有改变 那么就不会触发函数的调用
           console.log('触发了');
           return{
               name: '古龙水',
               price: this.price * this.num * (this.rate/100)
           }
       }
   }
 }
</script>

<style>
 
</style>
